package org.carry.god.module.system.controller.user;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.carry.god.framework.common.pojo.CommonResult;
import org.carry.god.module.system.controller.user.vo.UserSaveReqVO;
import org.carry.god.module.system.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wanglei
 */
@Tag(name = "用户管理")
@RestController
@RequestMapping("/system/user")
public class UserController {
    @Resource
    private UserService userService;
    @PostMapping("/create")
    @Operation(summary = "新增用户")
    public CommonResult<Long> createUser(@Valid @RequestBody UserSaveReqVO reqVO) {
        Long id = userService.createUser(reqVO);
        return CommonResult.success(id);
    }
}
